// 请求天气接口 && 保存天气数据到数据库------------
const axios = require("axios");

async function getOpenAiData(params) {
  let {url, uuid, platform, ip_info, messages, local} = params
  let open_ai_api = local ? "http://192.168.43.222:3000" + url : "http://116.204.91.36:3000" + url
  const options = {
    method: 'POST',
    uri: open_ai_api,
    json: {uuid, platform, ip_info, messages: messages},
    headers: {
      'content-type': 'application/json;charset=utf-8'
    }
  };
  let {data} = await axios(options)
  return data
}

module.exports = {
  getOpenAiData
}
